<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 指令能够控制自定义组件</title>
</head>
<body>
<div id="app">
    <cpn v-show="status"></cpn>
</div>

<template id="cpn">
    <h1>自定义组件内容</h1>
</template>

<script type="module">
    import {createApp, ref, defineComponent} from "../../../js/vue.esm-browser.js";

    let component = defineComponent(
        {
            template: "#cpn",
        }
    );

    let app = createApp(
        {
            setup() {
                let status = ref(true)
                return {
                    status,
                }
            }
        }
    );

    app.component("cpn", component)

    app.mount("#app")
</script>
</body>
</html>